package com.hz.controller;

import com.hz.pojo.PicUploadResult;
import com.hz.service.PicUploadService;
import com.hz.utils.MassageJsons;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/pic")
public class OssController {
    @Autowired
    private PicUploadService picUploadService;

    @PostMapping("/load")
    @ResponseBody
    public PicUploadResult upload(MultipartFile file,String open_id) {

       return picUploadService.upload(file,open_id);
    }
}
